#include "md-token.h"


namespace book
{

const char *MdToken::str(Type type) {
    switch (type) {
    case Type::Invalid:
        return "Invalid";
    case Type::Text:
        return "Text";
    case Type::StarItalic:
        return "StarItalic";
    case Type::StarBold:
        return "StarBold";
    case Type::StarBoldItalic:
        return "StarBoldItalic";
    case Type::UnderlineItalic:
        return "UnderlineItalic";
    case Type::UnderlineBold:
        return "UnderlineBold";
    case Type::UnderlineBoldItalic:
        return "UnderlineBoldItalic";
    case Type::DeleteLine:
        return "DeleteLine";
    case Type::Code:
        return "Code";
    case Type::UnnamedHrefLeftSide:
        return "UnnamedHrefLeftSide";
    case Type::UnnamedHrefRightSide:
        return "UnnamedHrefRightSide";
    default:
        return "Unknown";
    }
}

const char *MdToken::raw(Type type) {
    switch (type) {
    case Type::StarItalic:
        return "*";
    case Type::StarBold:
        return "**";
    case Type::StarBoldItalic:
        return "***";
    case Type::UnderlineItalic:
        return "_";
    case Type::UnderlineBold:
        return "__";
    case Type::UnderlineBoldItalic:
        return "___";
    case Type::DeleteLine:
        return "~~~";
    case Type::Code:
        return "`";
    case Type::UnnamedHrefLeftSide:
        return "<";
    case Type::UnnamedHrefRightSide:
        return ">";
    default:
        return "";
    }
}

} // namespace book
